@extends('layouts.h5')

@section('scripts')
    <script type="text/javascript" src="{{asset('swiper/js/swiper.min.js')}}"></script>
@stop

@section('content')
    <div class="home">
        <div class="header">
            <div class="game" id="game">
                <div class="left-top">
                    <div class="button-item" data-link="{{url('h5/tree')}}">
                        <img src="{{asset('images/h5/icons/cha.png')}}" class="icon">
                        <div class="text">茶多分{{$wallet['points']}}</div>
                    </div>
                    <div class="button-item" data-link="{{url('h5/tree')}}">
                        <img src="{{asset('images/h5/icons/libao.png')}}" class="icon">
                        <div class="text">礼包{{$treeCount}}</div>
                    </div>
                    {{--<div class="button-item" data-link="{{url('h5/tree')}}">--}}
                        {{--<img src="{{asset('images/h5/icons/taiyang.png')}}" class="icon">--}}
                        {{--<div class="text">能量{{$energy}}</div>--}}
                    {{--</div>--}}
                </div>

                <div class="right-top">
                    <div class="button-item" data-link="{{h5_page_url(46)}}">
                        <div class="text">了解证品荟</div>
                    </div>
                </div>

                <div class="right-bottom">
                    <div class="button-item" data-link="{{url('h5/invite')}}">
                        <img src="{{asset('images/h5/icons/yaoqinghaoyou.png')}}" class="icon">
                        <div class="text">邀请好友</div>
                    </div>
                </div>
                <audio id="misc">
          <source src="{{asset('images/game/sound.mp3')}}" type="audio/mpeg">
        </audio>
            </div>
        </div>

        <div class="buy-gift">
            <div class="tit">购买证品荟礼包</div>
        </div>
        <div class="gift-bag">
            <div class="swiper-div" style="padding-top: 40%;">
                <div class="swiper" id="swiper">
                    <ul class="swiper-wrapper">
                        @foreach ($foucsImgs as $img)
                            <li class="swiper-slide">
                                <a href="{{$img['url']}}">
                                    <div class="bg bg-cover" style="background-image: url({{image_url($img['image'])}})"></div>
                                </a>
                            </li>
                        @endforeach
                    </ul>
                    <div class="swiper-pagination" id="pagination-1"></div>
                </div>
            </div>
            <script type="text/javascript">
                (function(){
                    var swiper = new Swiper('#swiper',
                        {
                            loop:true,
                            pagination:'#pagination-1',
                            autoplay:2500,
                        });
                })();
            </script>
        </div>

        <div class="my-gift-bag">
            {{--<div class="button">我的礼包></div>--}}
            <h3>掌柜推荐</h3>
        </div>

        <div class="products">
            @foreach ($items as $item)
                <div class="product-item" data-link="{{h5_item_url($item['itemid'])}}">
                    <div class="image bg-cover" style="background-image: url({{image_url($item['poster'])}})">
                        @if ($item['stock']==0)
                            <div class="sold-out"></div>
                        @endif
                    </div>
                    <div class="info">
                        <div class="title">{{$item['title']}}</div>
                        <div class="price">￥{{$item['price']}}</div>
                    </div>
                    <div class="bottom">
                        <div class="flex"></div>
                        <div class="button" data-link="{{h5_item_url($item['itemid'])}}">立即购买</div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>
@stop

@section('foot')
    @include('h5.tabbar')
    <script src="{{asset('js/h5/game.js')}}"></script>
@stop
